/**
 * @param {number[]} cards
 * @param {number} cnt
 * @return {number}
 */
var maxmiumScore = function(cards, cnt) {
  let result = 0
  let odd = []
  let oddSum = 0
  let even = []
  let evenSum = 0
  for(let i = 0; i < cards.length; i++) {
      let num = cards[i]
      if (num % 2 === 0) { 
        odd.push(num)
      } else {
        even.push(num)
      }
  }
  odd.sort((a, b) => b - a)
  even.sort((a, b) => b - a)

  if (cnt <= odd.length) {
    for(let i = 0; i < cnt; i++) {
      result += odd[i]
    }
    return result
  }

  


  return result
};